package jee.boot.module.authority.rest;

import jee.boot.common.basic.CrudController;
import jee.boot.common.basic.result.ResponseMessage;
import jee.boot.common.basic.result.Result;
import jee.boot.module.authority.service.ModelDataService;
import jee.boot.entity.auth.ModelData;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 模型
 */
@RestController
@RequestMapping("/modelData")
public class ModelDataRestController extends CrudController<ModelDataService, ModelData> {

    /**
     * 查看
     *
     * @param entity
     * @return
     */
    @PostMapping("/getModelDataByCode")
    public ResponseMessage<ModelData> getModelDataByCode(@RequestBody ModelData entity) {
        ModelData data = service.getModelDataByCode(entity);
        return Result.success(data);
    }

    /**
     * 查看
     *
     * @param entity
     * @return
     */
    @PostMapping("/getModelDataById")
    public ResponseMessage<ModelData> getModelDataById(@RequestBody ModelData entity) {
        ModelData data = service.get(entity);
        return Result.success(data);
    }
}
